#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<queue>

using namespace std;

typedef long long ll;

ll n, k;

int main()
{
	priority_queue<ll> heap;
	ll sum = 0, x;

	cin >> n >> k;

	while (n--)
	{
		cin >> x;
		sum += x;
		if (x % 2 == 0)
		{
			heap.push(x);
		}
	}
	while (heap.size() && k--)
	{
		ll t = heap.top();
		heap.pop();
		t /= 2;
		sum -= t;
		if(t%2==0)
		heap.push(t);
	}

	cout << sum << endl;

	return 0;
}